<!--
 * @Author: ykr
 * @Date: 2024-05-14 19:54:40
 * @LastEditors: ykr
 * @LastEditTime: 2024-05-15 10:34:13
 * @FilePath: \zmglpt-ui-mobile-v1.1\dev\pages\query\school\components\CoordinateItem.vue
-->
<template>
  <view>
    <u-form :model="densForm" style="padding: 0px 10px;" ref="uForm" :error-type="errorType">
      <u-form-item label="坐标名称" required prop="pointName" :label-width="180">
        <u-input input-align="right" :custom-style="valueStyle" placeholder="请输入坐标名称" :disabled="isDisabled" v-model="densForm.pointName" />
      </u-form-item>
      <u-form-item label="位置类型" required prop="positionType" :label-width="180">
        <u-input input-align="right" :custom-style="valueStyle" placeholder="请输入坐标名称" :disabled="isDisabled" v-model="densForm.positionType" />
      </u-form-item>
      <u-form-item label="坐标" required prop="pointCoordinates" :label-width="180">
        <u-input input-align="right" placeholder="请选择" v-model="densForm.pointCoordinates" :disabled="true"></u-input>
        <!-- <u-icon name="map-fill" :color="$theme.u_type_primary" size="44" @click="!isDisabled && setLocation()"></u-icon> -->
      </u-form-item>
    </u-form>
  </view>
</template>

<script>
export default {
  props: {
    densData: {
      type: Object,
      default: () => { },
    },
    isDisabled: {   // 是否可编辑
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      errorType: ['border-bottom', 'message',],
      valueStyle: {
        marginRight: "5px",
      },
      densForm: {
        uuid: "",
        pointName: "",
        positionType: '',
        addr: "",
      },
      rules: {
        // 名称
        densName: [
          {
            required: true,
            message: "请输入坐标名称",
            trigger: ["change", "blur",],
          },
        ],
        addr: [
          {
            required: true,
            message: "请选择位置类型",
            trigger: ["change",],
          },
        ],
        densName: [
          {
            required: true,
            message: "请选择坐标",
            trigger: ["change", "blur",],
          },
        ]
      }
    }
  },
  onReady() {
    this.$refs.uForm && this.$refs.uForm.setRules(this.rules);
  },
  mounted() {
    // this.$refs.uForm.setRules(this.rules);
  },
  created() {
    Object.assign(this.densForm, this.densData,);
  }
}
</script>

<style>

</style>